<template>
  <div class="table_box_content">
    <el-table
      :data="compared_list"
      :header-cell-style="{'text-align':'center','background-color':'#F5F5F5 !important'}"
      :cell-style="{'text-align':'left'}"
      style="width: 100%;font-size: 16px;"
      border
      height="100%"
    >
      <el-table-column
        fixed
        label="姓名"
        width="128"
      >
        <template slot-scope="{row,$index}">
          <div style="text-align: center;">
            {{ row.userName }}
          </div>
        </template>
      </el-table-column>
      <el-table-column
        :label="title"
      >
        <template slot-scope="{row,$index}">
          <div class="p-10-0 flex" v-if="!row.contentList">暂无内容</div>
          <div v-else
               class="p-10-0 flex"
               v-for="(item,index) in row.contentList" :key="index">
            <span class="content-bit">{{ index + 1 }}</span>
            <span class="content-text-1" v-html="item.htmlText"></span>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>

export default {
  props: {
    compared_list: {
      type: Array,
      default: () => []
    },
    title: {
      type: String,
      default: ''
    }
  },
  data() {
    return {

    }
  },
  mounted() {

  },
  methods: {

  }
}
</script>

<style scoped>
/*table*/
.table_box_content {
  width: 100%;
  height: 100%;
}
.flex {
  display: flex;
}
.p-10-0 {
  padding: 0.5rem 0;
}
.b-b-1 {
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.content-bit {
  width: 17px;
  height:17px;
  margin-top: 4px;
  border-radius: 2px;
  background-color: rgba(59, 117, 255, 1);
  color: #FFFFFF;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.content-text-1 {
  flex: 1;
  margin-left: 7px;
  font-size: 16px;
}
::v-deep .user-tag {
  color: #fff;
  background-color: #07f;
  padding: 2px .4em;
  border-radius: 999em;
}
@media (max-width: 1024px) {
  .content-bit {
    width: 17px;
    height:17px;
    margin-top: 4px;
    border-radius: 2px;
    background-color: rgba(59, 117, 255, 1);
    color: #FFFFFF;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content-text-1 {
    flex: 1;
    margin-left: 7px;
    font-size: 14px;
  }
}
</style>
